package com.cx.zhshopping.ui.binding_adapter;

import androidx.databinding.BindingAdapter;

import com.youth.banner.Banner;
import com.youth.banner.adapter.BannerAdapter;
import com.youth.banner.indicator.Indicator;
import com.youth.banner.listener.OnPageChangeListener;

public class BannerBindingAdapter {

    @BindingAdapter(value = {"bannerAdapter"}, requireAll = false)
    public static void setAdapter(Banner banner, BannerAdapter adapter) {
        banner.setAdapter(adapter);
    }

    @BindingAdapter(value = {"Indicator"}, requireAll = false)
    public static void setIndicator(Banner banner, Indicator indicator) {
        banner.setIndicator(indicator);
    }

    @BindingAdapter(value = {"pageListener"}, requireAll = false)
    public static void bannerListener(Banner banner, OnPageChangeListener listener) {
        banner.addOnPageChangeListener(listener);
    }
}
